package com.openness.crawler.util;

import org.apache.hadoop.hbase.util.Bytes;

/**
 * @author Rain
 * @version 2013-5-21 下午3:31:33
 */

public final class Constants {

	public static final String HBASE_MASTER = "hbase.master";

	public static final String HBASE_ZOOKEEPER_QUORUM = "hbase.zookeeper.quorum";

	public static final String HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT = "hbase.zookeeper.property.clientPort";

	public static final String HBASE_TABLE_ROWKEY_SEPARATOR = "_";

	public static final byte[] HBASE_TABLE_FAMILY = Bytes.toBytes("baseinfo");

	public static final String HBASE_TABLE_DOCIDSERVER = "crawler_docidserver";

	public static final String HBASE_TABLE_WORKQUEUE = "crawler_workqueue";

	public static final String HBASE_TABLE_INPROCESSPAGESDB = "crawler_inprocesspagesdb";

	public static final String HBASE_TABLE_COUNTERS = "crawler_counters";

	public static final byte[] HBASE_TABLE_COUNTERS_ROWKEY = Bytes
			.toBytes("counters");

	public static final String HBASE_TABLE_DOCID_QUALIFIER_DOCID = "docid";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_URL = "url";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_DOCID = "docid";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_PARENTDOCID = "parentDocid";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_PARENTURL = "parentUrl";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_DEPTH = "depth";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_DOMAIN = "domain";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_SUBDOMAIN = "subDomain";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_PATH = "path";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_ANCHOR = "anchor";

	public static final String HBASE_TABLE_WEBURL_QUALIFIER_PRIORITY = "priority";

	public static final String ZK_SEPARATOR = "/";

	public static final String ZK_SUFFIX = "_";

	public static final String ZK_ROOT_DIR = ZK_SEPARATOR + "crawler";

	public static final String ZK_LOCK_DIR = ZK_ROOT_DIR + ZK_SEPARATOR
			+ "lock";

	public static final String ZK_COUNTERS_DIR = ZK_ROOT_DIR + ZK_SEPARATOR
			+ "counters";

	public static final String ZK_NODE_LASTDOCID = ZK_ROOT_DIR + ZK_SEPARATOR
			+ "lastdocid";

	public static final String ZK_NODE_SCHEDULEDPAGES = ZK_ROOT_DIR
			+ ZK_SEPARATOR + "scheduledpages";

	public static final String ZK_NODE_COUNTERS_SCHEDULEDPAGES = ZK_COUNTERS_DIR
			+ ZK_SEPARATOR + "scheduledpages";

	public static final String ZK_NODE_COUNTERS_PROCESSEDPAGES = ZK_COUNTERS_DIR
			+ ZK_SEPARATOR + "processedpages";

	public static final byte[] ZERO_BYTEARRAY = Bytes.toBytes(0L);

	public static final String ZK_LOCK_FRONTIER = ZK_LOCK_DIR + ZK_SEPARATOR
			+ "frontier";

	public static final String ZK_LOCK_DOCID = ZK_LOCK_DIR + ZK_SEPARATOR
			+ "docid";

	public static final String ZK_LOCK_COUNTERS = ZK_LOCK_DIR + ZK_SEPARATOR
			+ "counters";

	public static final String ZK_LOCK_PREFIX = "lock";

	public static final byte[] EMPTY_BYTEARRAY = Bytes.toBytes("");

	public static final String ZK_HBASE_TABLE_STATUS = ZK_ROOT_DIR
			+ ZK_SEPARATOR + "hbasestatus";

	public static final String ZK_SERVERS = ZK_ROOT_DIR + ZK_SEPARATOR
			+ "servers";

	public static final String ZK_SERVER_PREFIX = "server_";

	public static final String ZK_CRAWLING_THREAD = ZK_ROOT_DIR + ZK_SEPARATOR
			+ "crawlingthread";

	public static final String ZK_CRAWLING_THREAD_PREFIX = "cralwer_";

}
